package com.cmsky.open.user.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.base.model.AreaInfo;
import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.user.model.*;
import com.cmsky.open.user.dao.*;
import com.cmsky.open.user.manager.*;
import com.cmsky.open.user.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class UserAreaInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "UserAreaInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_USER_ID = "用户";
	public static final String ALIAS_AREA_ID = "社区大厦";
	public static final String ALIAS_ORDER_ID = "序号";
	public static final String ALIAS_COLLECT_ID = "归集人";
	public static final String ALIAS_COLLECT_STATE = "归集状态";
	public static final String ALIAS_STATE = "服务状态";
	public static final String ALIAS_FLOOR = "楼层号";
	public static final String ALIAS_ROOM = "房间号";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 用户       db_column: user_id 
     */	
	@NotNull 
	private java.lang.Integer userId;
    /**
     * 社区大厦       db_column: area_id 
     */	
	@NotNull 
	private java.lang.Integer areaId;
    /**
     * 序号       db_column: order_id 
     */	
	@NotNull @Max(127)
	private Integer orderId;
    /**
     * 归集人       db_column: collect_id 
     */	
	@NotNull 
	private java.lang.Integer collectId;
    /**
     * 归集状态       db_column: collect_state 
     */	
	@Max(127)
	private Integer collectState;
    /**
     * 服务状态       db_column: state 
     */	
	@Max(127)
	private Integer state;
    /**
     * 楼层号       db_column: floor 
     */	
	@Max(127)
	private Integer floor;
    /**
     * 房间号       db_column: room 
     */	
	@Max(127)
	private Integer room;
	//columns END

	public UserAreaInfo(){
	}

	public UserAreaInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setAreaId(java.lang.Integer value) {
		this.areaId = value;
	}
	
	public java.lang.Integer getAreaId() {
		return this.areaId;
	}
	public void setOrderId(Integer value) {
		this.orderId = value;
	}
	
	public Integer getOrderId() {
		return this.orderId;
	}
	public void setCollectId(java.lang.Integer value) {
		this.collectId = value;
	}
	
	public java.lang.Integer getCollectId() {
		return this.collectId;
	}
	public void setCollectState(Integer value) {
		this.collectState = value;
	}
	
	public Integer getCollectState() {
		return this.collectState;
	}
	public void setState(Integer value) {
		this.state = value;
	}
	
	public Integer getState() {
		return this.state;
	}
	public void setFloor(Integer value) {
		this.floor = value;
	}
	
	public Integer getFloor() {
		return this.floor;
	}
	public void setRoom(Integer value) {
		this.room = value;
	}
	
	public Integer getRoom() {
		return this.room;
	}
	
	private UserInfo userInfo;
	private UserInfo collector;
	
	public void setUserInfo(UserInfo userInfo){
		this.userInfo = userInfo;
	}
	
	public UserInfo getUserInfo() {
		return userInfo;
	}
	
	public UserInfo getCollector() {
		return collector;
	}

	public void setCollector(UserInfo collector) {
		this.collector = collector;
	}

	private AreaInfo areaInfo;
	
	public void setAreaInfo(AreaInfo areaInfo){
		this.areaInfo = areaInfo;
	}
	
	public AreaInfo getAreaInfo() {
		return areaInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserId",getUserId())
			.append("AreaId",getAreaId())
			.append("OrderId",getOrderId())
			.append("CollectId",getCollectId())
			.append("CollectState",getCollectState())
			.append("State",getState())
			.append("Floor",getFloor())
			.append("Room",getRoom())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof UserAreaInfo == false) return false;
		if(this == obj) return true;
		UserAreaInfo other = (UserAreaInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getUserId(),other.getUserId())
			.append(getAreaId(),other.getAreaId())
			.append(getOrderId(),other.getOrderId())
			.append(getCollectId(),other.getCollectId())
			.append(getCollectState(),other.getCollectState())
			.append(getState(),other.getState())
			.append(getFloor(),other.getFloor())
			.append(getRoom(),other.getRoom())
			.isEquals();
	}
}

